package com.mtons.mblog.modules.repository;

import com.mtons.mblog.modules.entity.Nav;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface NavRepository extends JpaRepository<Nav, Integer>, JpaSpecificationExecutor<Nav> {

	@Query("select coalesce(max(weight), 0) from Nav where navTypeId = :typeId")
	int maxWeight(@Param("typeId")Integer typeId);
	
}
